package com.fxd.crm.web.controller.studentTeach;

import com.fxd.crm.model.teach;
import com.fxd.crm.service.ITeachService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @auther fuxudong
 * @date 2021/4/5 - 11:17
 */
@Controller
@RequestMapping("/studentTeach")
public class studentTeachController {
    @Autowired
    ITeachService teachService;

    @RequestMapping("list")
    public String list() {
        return "studentTeach/list";
    }


    @RequestMapping("add")
    public String add() {
        return "studentTeach/add";
    }

    @RequestMapping("edit")
    public String edit(Model model , Integer teach_id) {
        teach teach = teachService.findByOrderId(teach_id);
        model.addAttribute("teach", teach);
        return "studentTeach/edit";
    }

    @RequestMapping("detail")
    public String detail(Model model, Integer teach_id) {
        teach teach = teachService.findByOrderId(teach_id);
        model.addAttribute("teach", teach);
        return "studentTeach/detail";
    }

}
